﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using System.IO;
using Microsoft.WindowsAzure;

namespace EncryptDecrypt
{   
    public class Program
    {
        /// <summary>
        /// Encrypt and decrypt test data using AES and Rijndael symmetric keys
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            AzureTableCrypto azCrypt = new AzureTableCrypto(EncryptionStrengthEnum.VeryWeak, null , null);

            bool didLoadCert = azCrypt.LoadCertificateByThumbprint("‎1e c3 26 00 da 34 05 c9 44 c7 75 18 84 c7 8b a7 e4 f4 ed 8b");

            azCrypt.TestRSA();

            string dataToEncrypt = "some arbitrary length data";
            var secureData = azCrypt.EncryptString(dataToEncrypt,null);
            var decryptedData = azCrypt.DecryptString(secureData.DataBase64String, secureData.KeyVersion);
        }

    }
}
